<extend file='resource/view/mobile'/>
<block name="title">会员注册 - HDCMS开源免费三网系统</block>
<block name="content">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">注册会员</h3>
        </div>
        <div class="panel-body">
            <div class="tab-content">
                <div class="active tab-pane fade in" id="tab1">
                    <form action="" method="post">
                        <div class="form-group">
                            <div class="col-sm-10">
                                <input type="text" name="username" class="form-control input-lg" placeholder="{{$placeholder}}">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-10">
                                <input type="password" name="password" class="form-control input-lg" placeholder="密码">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-10">
                                <input type="password" name="password2" class="form-control input-lg" placeholder="确认密码">
                            </div>
                        </div>
                        <button type="submit" class="btn btn-success btn-block btn-lg"> 立即注册</button>
                    </form>
                    <br/>
                    <a href="{{web_url('reg/login')}}">用户登录</a>
                    <!--<a href="{{web_url('reg/retrieve')}}" class="pull-right">找回密码</a>-->
                </div>
            </div>
        </div>
    </div>
</block>
<style>
    #tab1 div {
        padding : 0px;
    }
</style>
<script>
    $(function () {
        $("form").submit(function () {
            var msg = '';
            var username = $.trim($("[name='username']").val());
            if (username == '') {
                msg = '请填写手机号或邮箱<br/>';
            }
            if (!/^\d{11}$/.test(username) && !/^.+@.+$/.test(username)) {
                msg = '请填写手机号或邮箱<br/>';
            }
            if ($.trim($("[name='password']").val()) == '') {
                msg += '密码不能为空<br/>';
            }
            if ($("[name='password']").val() != $("[name='password2']").val()) {
                msg += '两次密码输入不一致<br/>';
            }
            if (msg.length > 0) {
                util.message(msg, '', 'error', {width: ''});
                return false;
            }
        });
    })
</script>